home *** CD-ROM | disk | FTP | other *** search
- /*
- * FILE: screen.h
- * AUTHOR: R. Gonzalez
- * CREATED: Oct. 3, 1990
- *
- * REVISED: Norman Gaskill
- * REV. DATE: Dec. 16, 1990
- * CHANGES: Added PC_Screen code
- *
- * Declaration of Screen, Mac_Screen, and PC_Screen classes, to
- * encapsulate machine-specific graphics code.
- */
-
- # ifndef screen_h
- # define screen_h
-
- # include "class.h"
- # include "frame.h"
- # include "coord.h"
- # include "color.h"
-
- # define MAX_WINDOWS 100
-
- /******************************************************************
- * Screen abstract class to isolate graphics I/O
- ******************************************************************/
- struct Screen:Generic_Class
- {
- Frame *device_frame;
- Frame *normalized_frame;
- int num_windows;
-
- boolean init(void);
- virtual int new_window(Frame*);
- virtual void make_closest(int);
- virtual void get_window_device_frame(int,Frame*);
- virtual double get_device_aspect_ratio(void);
- virtual void set_normalized_frame(double,double,double,double);
- virtual void set_current_window(int);
- virtual void set_pen_color(color);
- virtual void fill_window(void);
- virtual void draw_line(Coord2*,Coord2*);
- virtual void move_to(Coord2*);
- virtual void draw_to(Coord2*);
- virtual boolean mouse_button_is_down(void);
- virtual void wait(void);
- boolean destroy(void);
- };
-
- # ifdef THINK_C
-
- # include "WindowMgr.h"
-
- /******************************************************************
- * Mac_Screen class to allow graphics I/O on Macintosh computers
- ******************************************************************/
- struct Mac_Screen:Screen
- {
- WindowPtr window[MAX_WINDOWS];
- WindowPtr current_window;
- int old_mbar_height;
-
- boolean init(void);
- int new_window(Frame*);
- void make_closest(int);
- void get_window_device_frame(int,Frame*);
- void set_current_window(int);
- void set_pen_color(color);
- void fill_window(void);
- void move_to(Coord2*);
- void draw_to(Coord2*);
- boolean mouse_button_is_down(void);
- boolean destroy(void);
- };
-
- # else
-
- /******************************************************************
- * PC_Screen for graphics output on IBM PC compatibles
- ******************************************************************/
- struct PC_Screen:Screen
- {
- boolean init(void);
- int new_window(Frame*);
- void make_closest(int);
- void get_window_device_frame(int,Frame*);
- void set_current_window(int);
- void set_pen_color(int); /* can't use "color" in Turbo C++? */
- void fill_window(void);
- void move_to(Coord2*);
- void draw_to(Coord2*);
- void wait(void);
- boolean destroy(void);
- };
-
- # endif
- # endif
-